//
//  SizeUtil.m
//  sunshine
//
//  Created by Kyo-PC on 16/7/28.
//  Copyright © 2016年 Kyo-PC. All rights reserved.
//

#import "SizeUtil.h"

@implementation SizeUtil

+ (CGSize)sizeWithText:(NSString *)text font:(UIFont *)font maxSize:(CGSize)maxSize
{
    NSDictionary *attrs = @{NSFontAttributeName : font};
    return [text boundingRectWithSize:maxSize options:NSStringDrawingUsesLineFragmentOrigin attributes:attrs context:nil].size;
}

@end
